package com.qiantu.phone.ui.fragment;

import android.content.Intent;
import android.view.View;

import com.qiantu.phone.R;
import com.qiantu.phone.aop.SingleClick;
import com.qiantu.phone.app.TitleBarFragment;
import com.qiantu.phone.ui.activity.AirQualityActivityNew;
import com.qiantu.phone.ui.activity.HomeActivity;
import com.qiantu.phone.ui.activity.AirQualityActivity;
import com.qiantu.phone.ui.activity.HumidityActivity;
import com.qiantu.phone.ui.activity.SunriseSunSetActivityNew;
import com.qiantu.phone.ui.activity.TemperatureActivity;
import com.qiantu.phone.ui.activity.TemperatureActivityNew;
import com.qiantu.phone.ui.activity.WeatherActivity;
import com.qiantu.phone.ui.activity.SunriseSunsetActivity;
import com.qiantu.phone.ui.activity.WeatherActivityNew;
import com.qiantu.phone.ui.activity.map.LocationActivity;

/**
 * time   : 2021/12/22
 * desc   : 我的 Fragment
 */
public final class OutdoorFragmentNew extends TitleBarFragment<HomeActivity> {

    public static OutdoorFragmentNew newInstance() {
        return new OutdoorFragmentNew();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.ourdoor_fragment;
    }

    @Override
    protected void initView() {
        findViewById(R.id.btn_sunrise_sunset).setVisibility(View.GONE);
        setOnClickListener(R.id.btn_temperature, R.id.btn_humidity, R.id.btn_weather, R.id.btn_pm25, R.id.btn_sunrise_sunset);
    }

    @Override
    protected void initData() {

    }

    @SingleClick
    @Override
    public void onClick(View view) {
        Intent intent = null;
        switch (view.getId()) {
            case R.id.btn_temperature:
                intent = new Intent(getContext(), TemperatureActivityNew.class);
                intent.putExtra("environmentalType",2);
                intent.putExtra("isAdd",true);
                startActivity(intent);
                break;
            case R.id.btn_humidity:
                intent = new Intent(getContext(), TemperatureActivityNew.class);
                intent.putExtra("environmentalType",3);
                intent.putExtra("isAdd",true);
                startActivity(intent);
                break;
            case R.id.btn_weather:
                intent = new Intent(getContext(), WeatherActivityNew.class);
                intent.putExtra("isAdd",true);
                startActivity(intent);
                break;
            case R.id.btn_pm25:
                intent = new Intent(getContext(), AirQualityActivityNew.class);
                intent.putExtra("isAdd",true);
                startActivity(intent);
                break;
            case R.id.btn_sunrise_sunset:
                intent = new Intent(getContext(), SunriseSunSetActivityNew.class);
                intent.putExtra("isAdd",true);
                startActivity(intent);
                break;
        }
    }
}